<?php
	/**
	* Change cat survey state : Enable; Disable ;
	* @author trungdt
	* @since Apr, 2012
	*/

	if (!defined('EXPONENT')) exit('');
	
	$company = null;
	
	if (isset($_POST['id'])) {
			$company = $db->selectObject('surveymodule_companies','id='.intval($_POST['id']));
		$loc = unserialize($loc->location_data);
	} 
	
	if (isset($company->id) && exponent_permissions_check(array("administrate","create"),$loc))
	{

		if ($company->is_active == 0)
			$company->is_active=1;
		else
			$company->is_active=0;

		$db->updateObject($company,'surveymodule_companies');
		
		exponent_flow_redirect();
	}
	else {
		echo SITE_404_HTML;
	}

?>